﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BOMView.aspx.cs" Inherits="Main_Inventory_BOMView" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>View BOM</title>
    <link rel="Stylesheet" href="../../Styles/accounts.css" type="text/css" />
    <link href="../../Styles/ComboBox.css" rel="stylesheet" type="text/css" />
    <script src="../../Menu/js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">

        function doPrint(divprint) {
            var prtContent = document.getElementById(divprint);
            var WinPrint = window.open('', '', 'left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
        }
      function PrintBOM(ITMID,BOMID)
     {
       window.open('InventoryPrint/BOMDisplay.aspx?ITMID='+ITMID+'&BOMID='+BOMID+'','','');
     }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="divmain">
        <acc:heading id="pagehead" runat="server" headingtext="Bill of Material" />
    </div>
    <div style="width: 90%; margin-left: 5%; margin-right: 5%;">
        <div style="margin-left: 5%; margin-right: 5%; width: 90%" align="center">
            <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
        </div>
        
        <div align="center">
            Item: &nbsp;
            <asp:DropDownList ID="DDLSelectItem" runat="server" CssClass="dropdown" AutoPostBack="true"
                OnSelectedIndexChanged="DDLSelectItem_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
       
            <asp:DataList ID="DataListBom" runat="server" Width="100%" CellPadding="0" CellSpacing="5"
                DataKeyField="BOMID" OnItemDataBound="DataListBom_ItemDataBound" OnItemCommand="DataListBom_ItemCommand">
                <ItemTemplate>
                    <table class="tablecontentbg" style="width:50%; margin-left:25%; margin-right:25%; margin-top:10px;  border: 1px solid #e8e8e8"
                        cellspacing="0" cellpadding="0">
                        <tr>
                            <td  style="border-bottom: 1px solid #cfcfcf; background-color: #dfdfdf;">
                                        <asp:ImageButton ID="ImgBtn" runat="server" ToolTip="Print" ImageUrl="~/Images/print.png" ImageAlign="Left" />
                                        <asp:ImageButton ID="ImgButton" runat="server" ToolTip="Edit" ImageUrl="~/Menu/images/Edit_user.png"
                                         ImageAlign="Right"   CommandName="EditBOM" CommandArgument='<%#Eval("BOMID") %>' />
                                    
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div id="divprint">
                                <table id="tbl" runat="server" style="width:100%; border: 1px solid #cfcfcf"
                        cellspacing="0" cellpadding="0">
                                    
                                    <tr>
                                        <td style="width: 20%; border-bottom: 1px solid #cfcfcf; padding-left: 4px;">
                                            <b class="lablstyle">Item </b>
                                        </td>
                                        <td style="width: 40%; border-bottom: 1px solid #cfcfcf;">
                                            <%#Eval("ITMDESC")%>
                                        </td>
                                        <td style="width: 18%; border-bottom: 1px solid #cfcfcf;">
                                            <b class="lablstyle">UOM </b>
                                        </td>
                                        <td style="width: 22%; border-bottom: 1px solid #cfcfcf;">
                                            <%#Eval("UOMSYMBOL")%>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding-left: 4px; border-bottom: 1px solid #e8e8e8;">
                                            <b class="lablstyle">Quantity </b>
                                        </td>
                                        <td style="border-bottom: 1px solid #cfcfcf;">
                                            <%#string.Format("{0:0.00}",Eval("ITMQTY")) %>
                                        </td>
                                        <td style="border-bottom: 1px solid #cfcfcf;">
                                            <b class="lablstyle">Remarks </b>
                                        </td>
                                        <td style="border-bottom: 1px solid #cfcfcf; word-wrap: break-word;">
                                            <%#Eval("BOMREMARKS")%>
                                        </td>
                                    </tr>
                                <%--    <tr>
                                        <td style="width: 10%; padding-left: 4px;">
                                            <b class="lablstyle">Active </b>
                                        </td>
                                        <td>
                                            <%#Eval("BOMACTIVE")%>
                                        </td>
                                        <td>
                                            <b class="lablstyle">Edit in Transaction </b>
                                        </td>
                                        <td>
                                            <%#Eval("EDITINTRAN")%>
                                        </td>
                                    </tr>--%>
                                    <tr>
                                        <td colspan="4" style="padding: 0;">
                                            <asp:GridView ID="GrdBom" runat="server" Width="100%" Font-Size="11px" HeaderStyle-BackColor="#dfdfdf"
                                                BorderColor="#cfcfcf" RowStyle-BackColor="White" Style="margin: 0;" BorderWidth="1"
                                                AutoGenerateColumns="false" EmptyDataRowStyle-CssClass="emptyrow" EmptyDataText="No Record Found!"
                                                EmptyDataRowStyle-BackColor="#c9e8ee">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="S.No." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%">
                                                        <ItemTemplate>
                                                            <%# Container.DataItemIndex+1 %>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Item Name" DataField="ITMDESC" ItemStyle-Width="40%" />
                                                    <asp:BoundField HeaderText="UOM" DataField="UOMSYMBOL" ItemStyle-Width="18%" />
                                                    <asp:BoundField HeaderText="Quantity" DataField="ITMQTY" ItemStyle-HorizontalAlign="Right"
                                                        DataFormatString="{0:0.00}" ItemStyle-Width="22%" />
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    
                                </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:DataList>
      
        <%--  <table  class="tablecontent" style="width:99%; margin-left:4px;"  id="Tablepag1" runat="server" cellpadding="0" cellspacing="0"  >
                                    <tr>
                                        <td style="width:19%">
                                            <asp:LinkButton ID="LnkBtnPrevious" runat="server" OnClick="LnkBtnPrevious_Click" Text="Previous" CssClass="link"></asp:LinkButton>
                                        </td>
                                        
                                        <td style="width:60%" align="center">
                                         <asp:DataList ID="DLPaging" runat="server" OnItemCommand="DLPaging_ItemCommand" RepeatDirection="Horizontal" OnItemDataBound="DLPaging_ItemDataBound">
                                           <ItemTemplate>
                                               <asp:LinkButton ID="LnkBtnPaging" CommandArgument='<%# Eval("PageIndex") %>' Text='<%# Eval("PageText") %>' runat="server" CommandName="Paging" CssClass="link"></asp:LinkButton>
                                           </ItemTemplate>
                                         </asp:DataList>
                                        </td>
                                        <td align="right" style="width:19%; padding-right:5px;">
                                           <asp:LinkButton ID="LnkBtnNext" runat="server" OnClick="LnkBtnNext_Click" Text="Next" CssClass="link"></asp:LinkButton> 
                                        </td> 
                                    </tr>
                              </table>--%>
    </div>
    </form>
</body>
</html>
